package com.youlu.campus.common.model;

import com.youlu.campus.common.exception.ApiErrorCode;

public enum GlobalErrorCode implements ApiErrorCode {
    SUCCESS(1, "OK"),

    FAILURE(0, "Failure"),

    FAIL(500, "Failure"),

    BAD_REQUEST(400, "Bad Request"),
    UNAUTHORIZED(401, "Unauthorized"),
    FORBIDDEN(403, "Forbidden"),
    NOT_FOUND(404, "Not Found"),
    METHOD_NOT_ALLOWED(405, "Method Not Allowed"),

    INTERNAL_SERVER_ERROR(500, "Internal Server Error"),
    MONGO_COLLECTION_NOT_EXIT(3301, "MONGO COLLECTION NOT EXIST"),
    INVALID_PARAM(100, "参数错误"),

    UNSUPPORT_IMAGE_TYPE(110, "不支持的图片格式"),
    UNSUPPORT_STORE_PATH(111, "找不到文件"),
    NOT_CHOICE_ACTIVITY(500, "请先选择活动"),
    ACTIVITY_NOT_ACL(500, "你无当前活动相关权限"),
    NOT_FOND_TASK(500, "任务信息不存在"),
    NOT_FOND_RULE_INFO(500, "规则信息不存在"),
    NOT_FOND_PAY_CONFIG(500, "支付配置信息不存在"),
    NOT_FOND_PAY_BUTTON(500, "支付按钮信息不存在"),
    NOT_FOND_QA(500, "答题信息不存在"),
    NOT_FOND_QA_RULE(500, "答题信息规则不存在"),
    ;

    GlobalErrorCode(int code, String message) {
        this.code = code;
        this.message = message;
    }

    private final int code;

    private final String message;


    @Override
    public int getCode() {
        return this.code;
    }

    @Override
    public String getMessage() {
        return this.message;
    }
}
